home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 1.iso / dist / fw_qt.idb / usr / freeware / include / qsjiscodec.h.z / qsjiscodec.h
C/C++ Source or Header  |  2001-04-12  |  4KB  |  98 lines

  1. /****************************************************************************
  2. ** $Id: qt/src/tools/qsjiscodec.h   2.3.0   edited 2001-01-26 $
  3. **
  4. ** Definition of QSjisCodec class
  5. **
  6. ** Created : 990225
  7. **
  8. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of the tools module of the Qt GUI Toolkit.
  11. **
  12. ** This file may be distributed under the terms of the Q Public License
  13. ** as defined by Trolltech AS of Norway and appearing in the file
  14. ** LICENSE.QPL included in the packaging of this file.
  15. **
  16. ** This file may be distributed and/or modified under the terms of the
  17. ** GNU General Public License version 2 as published by the Free Software
  18. ** Foundation and appearing in the file LICENSE.GPL included in the
  19. ** packaging of this file.
  20. **
  21. ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
  22. ** licenses may use this file in accordance with the Qt Commercial License
  23. ** Agreement provided with the Software.
  24. **
  25. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  26. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  27. **
  28. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  29. **   information about Qt Commercial License Agreements.
  30. ** See http://www.trolltech.com/qpl/ for QPL licensing information.
  31. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  32. **
  33. ** Contact info@trolltech.com if any conditions of this licensing are
  34. ** not clear to you.
  35. **
  36. **********************************************************************/
  37.  
  38. // Most of the code here was originally written by Serika Kurusugawa
  39. // a.k.a. Junji Takagi, and is include in Qt with the author's permission,
  40. // and the grateful thanks of the Trolltech team.
  41.  
  42. /*
  43.  * Copyright (c) 1999 Serika Kurusugawa, All rights reserved.
  44.  *
  45.  * Redistribution and use in source and binary forms, with or without
  46.  * modification, are permitted provided that the following conditions
  47.  * are met:
  48.  * 1. Redistributions of source code must retain the above copyright
  49.  *    notice, this list of conditions and the following disclaimer.
  50.  * 2. Redistributions in binary form must reproduce the above copyright
  51.  *    notice, this list of conditions and the following disclaimer in the
  52.  *    documentation and/or other materials provided with the distribution.
  53.  *
  54.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  55.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  56.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  57.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  58.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  59.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  60.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  61.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  62.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  63.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  64.  * SUCH DAMAGE.
  65.  */
  66.  
  67. #ifndef QSJISCODEC_H
  68. #define QSJISCODEC_H
  69.  
  70. #ifndef QT_H
  71. #include "qtextcodec.h"
  72. #include "qjpunicode.h"
  73. #endif // QT_H
  74.  
  75. #ifndef QT_NO_CODECS
  76.  
  77. class Q_EXPORT QSjisCodec : public QTextCodec {
  78. public:
  79.     virtual int mibEnum() const;
  80.     const char* name() const;
  81.  
  82.     QTextDecoder* makeDecoder() const;
  83.  
  84.     QCString fromUnicode(const QString& uc, int& len_in_out) const;
  85.     QString toUnicode(const char* chars, int len) const;
  86.  
  87.     int heuristicContentMatch(const char* chars, int len) const;
  88.     int heuristicNameMatch(const char* hint) const;
  89.  
  90.     QSjisCodec();
  91.  
  92. protected:
  93.     const QJpUnicodeConv * const conv;
  94. };
  95.  
  96. #endif
  97. #endif
  98.